public class Test7 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread("t1"){
            @Override
            public void run() {
                System.out.println("sleep");
                try {
                    sleep(2000);
                } catch (InterruptedException e) {
                    System.out.println("wake up");
                    System.out.println(e);
                    System.out.println("还在ma");
                }
                System.out.println("还在");
            }
        };
        t1.start();

        Thread.sleep(1000);
        System.out.println("interrupt");
        t1.interrupt();
    }
}
